﻿#ifndef __DAHUA_GENICAM_GENERAL_PARAMETERS_H__
#define __DAHUA_GENICAM_GENERAL_PARAMETERS_H__

#include "Defs.h"
#include "Camera.h"
#include "Infra/CString.h"

GENICAM_NAMESPACE_BEGIN

class CIntNode;
class CDoubleNode;
class CEnumNode;
class CBoolNode;
class CCmdNode;
class CStringNode;

typedef Memory::TSharedPtr<CIntNode> CIntNodePtr;
typedef Memory::TSharedPtr<CDoubleNode> CDoubleNodePtr;
typedef Memory::TSharedPtr<CEnumNode> CEnumNodePtr;
typedef Memory::TSharedPtr<CBoolNode> CBoolNodePtr;
typedef Memory::TSharedPtr<CCmdNode> CCmdNodePtr;
typedef Memory::TSharedPtr<CStringNode> CStringNodePtr;


/// \~chinese
/// \brief 甯哥敤鍙傛暟瀵硅薄鎺ュ彛
/// \defgroup config 灞炴€ч厤缃浉鍏虫搷浣沧帴鍙?
/// \~english
/// \brief common parameter object interface
/// \defgroup config Property Operation interface
/// @{

/// \~chinese
/// \brief Class CNodeBase 灞炴€ф搷浣滃熀绫绘帴鍙?
/// \~english
/// \brief Class CNodeBase property operation base class interface
class GENICAM_API CNodeBase
{
public:
	virtual ~CNodeBase();

public:
	/// \~chinese
	/// \brief 灞炴€ф槸鍚﹀彲鐢?
	/// \return 鍙敤杩斿洖true锛屽惁鍒栾繑锲瀎alse
	/// \~english
	/// \brief check the property is available or not
	/// \return available:true, not available:false
	bool isAvailable() const;

	/// \~chinese
	/// \brief 灞炴€ф槸鍚﹀彲璇?
	/// \return 鍙杩斿洖true锛屽惁鍒栾繑锲瀎alse
	/// \~english
	/// \brief check the property is readable or not
	/// \return readable:true, not readable:false
	bool isReadable() const;

	/// \~chinese
	/// \brief 灞炴€ф槸鍚﹀彲鍐?
	/// \return 鍙啓杩斿洖true锛屽惁鍒栾繑锲瀎alse
	/// \~english
	/// \brief check the property is writeable or not
	/// \return writeable:true, not writeable:false
	bool isWriteable() const;

	/// \~chinese
	/// \brief 灞炴€ф槸鍚treamable
	/// \return 鏄垯杩斿洖true锛屽惁鍒栾繑锲瀎alse
	/// \~english
	/// \brief check the property is streamable or not
	/// \return streamable:true, not streamable:false
	bool isStreamable() const;

	/// \~chinese
	/// \brief 鍒ゆ柇灞炴€ф槸鍚︽湁鏁?
	/// \return 鏄垯杩斿洖true锛屽惁鍒栾繑锲瀎alse
	/// \~english
	/// \brief check the property is valid or not
	/// \return valid:true, invalid:false
	bool isValid() const;

protected:
	CNodeBase(const ICameraPtr& ptrCamera, const char* pParamName);
	CNodeBase(const CNodeBase& other);
	CNodeBase& operator= (const CNodeBase& other);

protected:
	class	Impl;
	Impl*	m_pImpl;
};

/// \~chinese
/// \brief Class IIntNode 鏁村瀷灞炴€ф搷浣灭被
/// \~english
/// \brief Class IIntNode integer property operation class
class GENICAM_API CIntNode : public CNodeBase
{
public:
	CIntNode(const ICameraPtr& ptrCamera, const char* pParamName);
	~CIntNode();

public:
	/// \~chinese
	/// \brief 銮峰彇灞炴€у€?
	/// \param [out] val 銮峰彇鍒扮殑灞炴€у€?
	/// \return 鎴愬姛杩斿洖true锛屽惁鍒柽alse
	/// \~english
	/// \brief get property's value
	/// \param [out] val the property's value
	/// \return success:true, fail:false
	bool getValue(int64_t& val) const;

	/// \~chinese
	/// \brief 璁剧疆灞炴€у€?
	/// \param [in] val 寰呰缃殑灞炴€у€?
	/// \return 鎴愬姛鍒栾繑锲潇rue锛屽惁鍒栾繑锲瀎alse
	/// \~english
	/// \brief set the property's value
	/// \param [in] val the value to be set for this property
	/// \return success:true, fail:false
	bool setValue(int64_t val);

	/// \~chinese
	/// \brief 銮峰彇灞炴€у彲璁炬渶灏忓€?
	/// \param [out] val 銮峰彇鍒扮殑灞炴€ф渶灏忓€?
	/// \return 鎴愬姛杩斿洖true锛屽惁鍒柽alse
	/// \~english
	/// \brief get the property's minimum value that can be set
	/// \param [out] val the property's minimum value
	/// \return success:true, fail:false
	bool getMinVal(int64_t& val) const;

	/// \~chinese
	/// \brief 銮峰彇灞炴€у彲璁炬渶澶у€?
	/// \param [out] val 銮峰彇鍒扮殑灞炴€ф渶澶у€?
	/// \return 鎴愬姛杩斿洖true锛屽惁鍒柽alse
	/// \~english
	/// \brief get the property's maximum value that can be set
	/// \param [out] val the property's maximum value
	/// \return success:true, fail:false
	bool getMaxVal(int64_t& val) const;

	/// \~chinese
	/// \brief 銮峰彇灞炴€ф闀?
	/// \param [out] val 銮峰彇鍒扮殑灞炴€ф闀?
	/// \return 鎴愬姛杩斿洖true锛屽惁鍒柽alse
	/// \~english
	/// \brief get property's increment
	/// \param [out] val the property's increment
	/// \return success:true, fail:false
	bool getIncrement(int64_t& val) const;
};

/// \~chinese
/// \brief Class IDoubleNode 娴偣鏁板睘镐ф搷浣灭被
/// \~english
/// \brief Class IDoubleNode float property operation class
class GENICAM_API CDoubleNode : public CNodeBase
{
public:
	CDoubleNode(const ICameraPtr& ptrCamera, const char* pParamName);
	~CDoubleNode();

public:
	/// \~chinese
	/// \brief 銮峰彇灞炴€у€?
	/// \param [out] val 銮峰彇鍒扮殑灞炴€у€?
	/// \return 鎴愬姛杩斿洖true锛屽惁鍒柽alse
	/// \~english
	/// \brief get property's value
	/// \param [out] val the property's value
	/// \return success:true, fail:false
	bool getValue(double& val) const;

	/// \~chinese
	/// \brief 璁剧疆灞炴€у€?
	/// \param [in] val 寰呰缃殑灞炴€у€?
	/// \return 鎴愬姛鍒栾繑锲潇rue锛屽惁鍒栾繑锲瀎alse
	/// \~english
	/// \brief set property's value
	/// \param [in] val the value to be set for this property
	/// \return success:true, fail:false
	bool setValue(double val);

	/// \~chinese
	/// \brief 銮峰彇灞炴€у彲璁炬渶灏忓€?
	/// \param [out] val 銮峰彇鍒扮殑灞炴€ф渶灏忓€?
	/// \return 鎴愬姛杩斿洖true锛屽惁鍒柽alse
	/// \~english
	/// \brief get the property's minimum value that can be set
	/// \param [out] val the property's minimum value
	/// \return success:true, fail:false
	bool getMinVal(double& val) const;

	/// \~chinese
	/// \brief 銮峰彇灞炴€у彲璁炬渶澶у€?
	/// \param [out] val 銮峰彇鍒扮殑灞炴€ф渶澶у€?
	/// \return 鎴愬姛杩斿洖true锛屽惁鍒柽alse
	/// \~english
	/// \brief get the property's maximum value that can be set
	/// \param [out] val the property's maximum value
	/// \return success:true, fail:false
	bool getMaxVal(double& val) const;
};

/// \~chinese
/// \brief Class IEnumNode 鏋氢妇鍨嫔睘镐ф搷浣灭被
/// \~english
/// \brief  Class IEnumNode EnumNode property operation class
class GENICAM_API CEnumNode : public CNodeBase
{
public:
	CEnumNode(const ICameraPtr& ptrCamera, const char* pParamName);
	~CEnumNode();

public:
	/// \~chinese
	/// \brief 銮峰彇鏋氢妇灞炴€ymbol链?
	/// \param [out] val  銮峰彇鍒扮殑灞炴€у€?
	/// \return 鎴愬姛杩斿洖true锛屽惁鍒柽alse
	/// \~english
	/// \brief get symbol value of enum property
	/// \param [out] val the property's value
	/// \return success:true, fail:false
	bool getValueSymbol(Infra::CString& val) const;

	/// \~chinese
	/// \brief 璁剧疆鏋氢妇灞炴€ymbol链?
	/// \param [in] strSymbolName 寰呰缃殑灞炴€у€?
	/// \return 鎴愬姛鍒栾繑锲潇rue锛屽惁鍒栾繑锲瀎alse
	/// \~english
	/// \brief set symbol value of enum property 
	/// \param [in] strSymbolName the value waiting to be set for this property
	/// \return success:true, fail:false
	bool setValueBySymbol(const Infra::CString& strSymbolName);

	/// \~chinese
	/// \brief 銮峰彇鏋氢妇灞炴€у彲璁剧疆镄剆ymbol链煎垪琛?
	/// \return 杩斿洖灞炴€у綋鍓嶅彲璁剧疆symbol链煎垪琛?
	/// \~english
	/// \brief Get the list of Enum property symbol value which can be set
	/// \return Return the list of Enum property symbol value which can be set now
	Infra::TVector<Infra::CString> getEnumSymbolList() const;
};

/// \~chinese
/// \brief Class IBoolNode 甯冨皵鍨嫔睘镐ф搷浣灭被
/// \~english
/// \brief Class IBoolNode BoolNode property operation class
class GENICAM_API CBoolNode : public CNodeBase
{
public:
	CBoolNode(const ICameraPtr& ptrCamera, const char* pParamName);
	~CBoolNode();

public:
	/// \~chinese
	/// \brief 銮峰彇灞炴€у€?
	/// \param [out] val 銮峰彇鍒扮殑灞炴€у€?
	/// \return 鎴愬姛杩斿洖true锛屽惁鍒柽alse
	/// \~english
	/// \brief get property's value
	/// \param [out] val the property's value
	/// \return success:true, fail:false
	bool getValue(bool& val) const;

	/// \~chinese
	/// \brief 璁剧疆灞炴€у€?
	/// \param [in] val 寰呰缃殑灞炴€у€?
	/// \return 鎴愬姛鍒栾繑锲潇rue锛屽惁鍒栾繑锲瀎alse
	/// \~english
	/// \brief set property's value
	/// \param [in] val the value to be set for this property
	/// \return success:true, fail:false
	bool setValue(bool val);
};

/// \~chinese
/// \brief Class ICmdNode 锻戒护鍨嫔睘镐ф搷浣灭被
/// \~english
/// \brief Class ICmdNode CmdNode property operation class
class GENICAM_API CCmdNode : public CNodeBase
{
public:
	CCmdNode(const ICameraPtr& ptrCamera, const char* pParamName);
	~CCmdNode();

public:
	/// \~chinese
	/// \brief 镓ц锻戒护绫诲瀷灞炴€?
	/// \return 鎴愬姛鍒栾繑锲潇rue锛屽惁鍒栾繑锲瀎alse
	/// \~english
	/// \brief execute command property
	/// \return success:true, fail:false
	bool execute();
};

/// \~chinese
/// \brief Class IStringNode 锻戒护鍨嫔睘镐ф搷浣灭被
/// \~english
/// \brief Class IStringNode StringNode property operation class
class GENICAM_API CStringNode : public CNodeBase
{
public:
	CStringNode(const ICameraPtr& ptrCamera, const char* pParamName);
	~CStringNode();

public:
	/// \~chinese
	/// \brief 銮峰彇灞炴€у€?
	/// \param [out] outStr 銮峰彇鍒扮殑灞炴€у€?
	/// \return 鎴愬姛杩斿洖true锛屽惁鍒柽alse
	/// \~english
	/// \brief get property's value
	/// \param [out] outStr the property's value
	/// \return success:true, fail:false
	bool getValue(Infra::CString &outStr);

	/// \~chinese
	/// \brief 璁剧疆灞炴€у€?
	/// \param [in] inStr 寰呰緭鍏ョ殑灞炴€у€?
	/// \return 鎴愬姛鍒栾繑锲潇rue锛屽惁鍒栾繑锲瀎alse
	/// \~english
	/// \brief set the property's value
	/// \param [in] inStr the value to be set for this property
	/// \return success:true, fail:false
	bool setValue(const Infra::CString &inStr);
};

/// @}
GENICAM_NAMESPACE_END

#endif // __DAHUA_GENICAM_GENERAL_PARAMETERS_H__
